package com.luli.controllor;

import com.luli.entity.sort.AdjustOrderReq;
import com.luli.entity.response.ResponseMsg;
import com.luli.service.NoticeTypeService;
import io.netty.util.internal.ObjectUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import static com.luli.Utils.ResponseMsgUtil.getFailMsg;
import static com.luli.Utils.ResponseMsgUtil.getSuccessMsg;

/**
 * 陆离
 * 2022/7/5 19:50:33
 */
@RestController
@Slf4j
@RequestMapping("/test")
@CrossOrigin
public class SortController {
    @Autowired
    private NoticeTypeService noticeTypeService;


    @PostMapping("/adjustorder")
    public ResponseMsg adjustOrder(@RequestBody AdjustOrderReq orderReq) {
        int a = noticeTypeService.adjustOrder(orderReq);
        if (a != 1) {
            return getFailMsg(null, String.valueOf(a), null);

        }
        return getSuccessMsg(null, "成功新增：" + a + "条数据", null);
    }

}
